<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="/favicon.ico">

    <title>CppCloud -- 管理后台</title>

    <!-- Bootstrap core CSS -->
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
      <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <script type="text/javascript">
      function gotoTop(){
          console.log("gototop run")
          window.scroll(0,0);
          return false;
      }
    </script>
    <style>
        #idtop {
            position: fixed;
            right: 10px;
            bottom: 20px;
        }
    </style>

  <body>

    <!-- Static navbar -->
    <nav  class="navbar navbar-default navbar-fixed-top">
      <div class="container">
          <div class="navbar-header">
              <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
              </button>
          <a class="navbar-brand" href="http://www.cppcloud.cn/">CppCloud</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
          <ul class="nav navbar-nav">
            <li class="active">
              <a href="main.html" target="context_main">连接</a>
            </li>
            <li>
                <a href="conf.html" target="context_main">配置</a>
            </li>
            <li>
              <a href="prvd.html" target="context_main">服务</a>
            </li>
            <!-- <li class="active">
              <a href="prvd.html" target="context_main">服务</a>
            </li> -->
            <li><a href="log.html" target="context_main">日志</a></li>
            
          </ul>
          <ul class="nav navbar-nav navbar-right">
            <li>
              <a href="http://www.cppcloud.cn/" >官方blog</a>
            </li>
            <li>
              <a href="about.html" target="context_main">关于</a>
            </li>
            <li><a href="help.html" target="context_main">帮助</a></li>
            
          </ul>
        </div><!--/.nav-collapse -->
      </div>
    </nav>

    <nav id="idtop">
        <button onclick="gotoTop()" 
          type="button" class="btn btn-default btn-sm" aria-label="Left Align">
            <span class="glyphicon glyphicon-chevron-up" aria-hidden="true"></span>
        </button>
    </nav>

    <div class="container" style="margin-top: 54px; ">
        
        <iframe id="mainFrame" name="context_main" width="100%" height="5000"
         src="main.html"  frameborder="0" scrolling="no"></iframe>

    </div>


  </body>

  <script src="jquery-3.3.1.js" type="text/javascript"> </script>
  <script>


    var dom_activ = null;
	var onTopMenuClick = function(){ //此处的this是被点的<a>
		console.log(this.innerText);
		var jtag = $(this);
		var eqr = (dom_activ === this);

		if (!eqr)
		{
      $('li.active').removeClass("active");
			jtag.addClass("active");
			if (dom_activ) {
				//$(dom_activ).removeClass("active");
			}
			
			dom_activ = this;
		}

		// return !eqr;
		return true;
	};

	$(function() {
		var atags = $("#navbar>ul>li");
		//alert(atag.length);
		atags.click(onTopMenuClick);
		// atags.first().click();
	});

  </script>
</html>